package net.da.client;

import net.da.client.common.component.ComponentDispatcher;
import net.da.client.common.component.ComponentDispatcherImpl;
import net.da.client.constants.DAConstants;

import com.google.gwt.core.client.EntryPoint;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class DaHome implements EntryPoint {

//	/**
//	 * This is the entry point method.
//	 */
//	public void onModuleLoad0() {
//		final Button button = new Button("Click me");
//		final Label label = new Label();
//
//		button.addClickListener(new ClickListener() {
//			public void onClick(Widget sender) {
//				if (label.getText().equals(""))
//					label.setText("Hello World!");
//				else
//					label.setText("");
//                
//                //onModuleLoad0();
//			}
//		});
//
//		// Assume that the host HTML has elements defined whose
//		// IDs are "slot1", "slot2". In a real app, you probably would not want
//		// to hard-code IDs. Instead, you could, for example, search for all
//		// elements with a particular CSS class and replace them with widgets.
//		//
//		RootPanel.get("slot1").add(button);
//		RootPanel.get("slot2").add(label);
//	}

	public void onModuleLoad() {
		loadMainComponent();
	}

	private void loadMainComponent() {

		ComponentDispatcher dispatcher = ComponentDispatcherImpl.getInstance();
		dispatcher.jumpTo(DAConstants.COMPONENTS_NAMES.LOGIN_COMPONENT);
	}

}
